package io.lkt.modules.sys.service;

import com.baomidou.mybatisplus.extension.service.IService;
import io.lkt.common.util.Query;
import io.lkt.common.utils.PageUtils;
import io.lkt.modules.sys.entity.BArticleInfoEntity;
import io.lkt.modules.sys.entity.BUserShareArticleInfoEntity;
import io.lkt.modules.sys.entity.SpiderTaskEntity;
import org.apache.ibatis.annotations.Param;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * 文章信息表
 *
 * @author xss
 * @email dustwas@163.com
 * @date 2019-03-11 09:43:10
 */
public interface BArticleInfoService extends IService<BArticleInfoEntity> {

    PageUtils queryPageForUserId(Map<String, Object> params);

    PageUtils queryPage(Map<String, Object> params);

    Integer queryTotal(Map<String, Object> map);

    List<BArticleInfoEntity> queryList(Map<String, Object> map);

    Integer titleTotal(String articleTitle,String brandId);

    List<BArticleInfoEntity> informArticel(Map<String, Object> map);

    Integer informArticelTotal(Map<String, Object> map);

    List<SpiderTaskEntity> getSpiderTaskList();

    SpiderTaskEntity getSpiderTaskById(Integer id);

    void updateImportStute(Integer id);

    void setNullArticleBrandId( Integer id);

    void setNullArticleTypeId( Integer id);

    List<BArticleInfoEntity> queryArticleInfoByArticleBrandForHotScore(Integer articleBrandId,Integer recordSize);

    List<BArticleInfoEntity> queryArticleInfoByArticleTypeForHotScore(Integer articleTypeId, Integer recordSize);

    @Override
    BArticleInfoEntity getById(Serializable id);

    @Override
    boolean save(BArticleInfoEntity entity);

    @Override
    boolean updateById(BArticleInfoEntity entity);

    void updateSourceHeight(Integer id, Integer height);

    void headlineRelation(Integer articleId, List<Integer> headlineTitleIds,Integer userId);

    List<Integer> selectHeadlineIdsByArticleId(Integer id);

    void delHeadlineRelation(Integer id);

    List<BUserShareArticleInfoEntity> getUserCopyInfo(Map<String, Object> params);

    int getUserCopyInfoTotal(Map<String, Object> params);

    int getUserArticleCount(Integer userId);

    void updateArticleDesc(String articleDesc, String[] articleNewDesc, Integer type);

    void updateArticleContent(Integer brandId, String content, String[] newContents);

    Map<String, Object> getProgressInfo();

    void deleteHalfYearAgoArticle();

    /**
     * 获取品牌下最新的文章
     * @param brandId
     * @return
     */
    BArticleInfoEntity getLatestArticleByBranbId(Integer brandId);

    /**
     * 获取新手文章
     * @param id 文章ID
     * @return
     */
    BArticleInfoEntity getBeginnerArticleById(Integer id);
}

